package com.liuyjy.mybatisplus.util;

import java.io.File;
import java.io.FileNotFoundException;

import static org.springframework.util.ResourceUtils.getFile;

/**
 * @Author liuyjy
 * @Date 2022/1/18 13:03
 * @Description: 数据清空
 **/
public class Clean {

    //清除模块下文件夹
    private final static String[] PATHS = {"controller", "mapper", "entity", "service"};

    public static void main(String[] args) throws FileNotFoundException {
        for (String path : PATHS) {
            File file = getFile(path);
            CleanUtil.deleteFiles(file);
        }
        //删除mapper下的文件
        CleanUtil.clearResources();
        System.out.println("数据已清空");
    }

}

